import 'package:flutter/material.dart';
import 'dart:math';

extension ColorExtension on Color{
  static Color hexColor(int hex,{double alpha = 1}){
    if (alpha < 0){
      alpha = 0;
    }else if (alpha > 1){
      alpha = 1;
    }
    return Color.fromRGBO((hex & 0xFF0000) >> 16 ,
        (hex & 0x00FF00) >> 8,
        (hex & 0x0000FF) >> 0,
        alpha);
  }

  static Color get randomColor{
    return Color.fromARGB(
        Random().nextInt(256),
        Random().nextInt(256),
        Random().nextInt(256),
        Random().nextInt(256)
    );
  }

}